<?php

/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
*/
/**
 * Description of AdminInfo
 *
 * @author hoangle
 */
class Answer {

//put your code here
    private $db;
    
    public function  __construct() {
        $this->db = Zend_Registry::get('db');
    }

    /**
     * @desc Insert account info
     * @param <array> $arrParams
     * @return true | false
     */
    public function getListAnswerInfo($userid) {
        try {
            $sql = "SELECT * FROM tbluserquestions WHERE userid=:p_userid AND status=1 AND
                answer_flag=1 AND refuse=0";
            $stmt = $this->db->prepare($sql);
            $stmt->bindParam(':p_userid', $userid, PDO::PARAM_INT   );
            $stmt->execute();
            $result = $stmt->fetchAll();
            $stmt->closeCursor();
        }
        catch (Zend_Db_Exception $e) {
            throw new Zend_Exception($e->getMessage(), 11);
        }
        return $result;
    }
    //End func
    
}

?>
